package exercise;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Collectors;

public class Exercise6 {
	public static void main(String[] args) {
		ArrayList<Integer> list1 = new ArrayList<>();
		Collections.addAll(list1, 1,2,2,3,4,5,6,4,3,2,2);
		ArrayList<Integer> list2 = list1.stream()
                .distinct()
                .collect(Collectors.toCollection(ArrayList::new));

        System.out.println(list2);
	}
}
